package com.gec.mall.service.impl;

import com.gec.mall.mapper.TbItemCatMapper;
import com.gec.mall.pojo.TbItemCat;
import com.gec.mall.pojo.TbItemCatExample;
import com.gec.mall.service.ItemCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: li
 * @Date: 2023/2/3
 * @PACKAGE_NAME:com.gec.mall.service.impl
 * @Project_Name:mall-parent
 * @VERSION: 1.0.0
 */
@Service
public class ItemCategoryServiceImpl implements ItemCategoryService {

    @Autowired
    private TbItemCatMapper itemCatMapper;

    @Override
    public List<TbItemCat> getItemCatByParentId(Long id) {
        TbItemCatExample example = new TbItemCatExample();
        TbItemCatExample.Criteria criteria = example.createCriteria();
        criteria.andParentIdEqualTo(id);
        List<TbItemCat> tbItemCats = itemCatMapper.selectByExample(example);
        return tbItemCats;
    }
}
